import Vue from "vue";
import VueRouter from "vue-router";
import login from "../views/login.vue";
import Goods from "../views/goods/Goods.vue";
import Order from "../views/pay/Order.vue";
// import User from "../views/system/User";
// import Module from "../views/system/Module"
// import Role from "../views/system/Role"
// import Dept from "../views/system/Dept"
// import Variable from "../views/system/Variable"
// import Permission from "../views/system/Permission"
import MachineConfig from "../views/service/MachineConfig"
import Config from "../views/service/Config"

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "login",
    component: login,
  },
  {
    path: "/index",
    name: "index",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/index.vue"),
    children: [
      {
        path: "/goods/Goods",
        name: "系统信息",
        component: Goods,
        // component:()=>{
        //   import("../views/goods/Goods.vue")
        // },
        meta: {
          requireAuth: true,
        },
      },
      {
        path: "/pay/Order",
        name: "交易订单",
        component: Order,
        meta: {
          requireAuth: true,
        },
      },
      // {
      //   path: "/system/User",
      //   name: "用户管理",
      //   component: User,
      //   meta: {
      //     requireAuth: true,
      //   },
      // },
      // {
      //   path: "/system/Module",
      //   name: "菜单管理",
      //   component: Module,
      //   meta: {
      //     requireAuth: true,
      //   },
      // },
      // {
      //   path: "/system/Role",
      //   name: "角色管理",
      //   component: Role,
      //   meta: {
      //     requireAuth: true,
      //   },
      // },
      // {
      //   path: "/system/Dept",
      //   name: "公司管理",
      //   component: Dept,
      //   meta: {
      //     requireAuth: true,
      //   },
      // },
      // {
      //   path: "/system/Variable",
      //   name: "系统环境变量",
      //   component: Variable,
      //   meta: {
      //     requireAuth: true,
      //   },
      // },
      // {
      //   path: "/system/Permission",
      //   name: "权限管理",
      //   component: Permission,
      //   meta: {
      //     requireAuth: true,
      //   },
      // },
      {
        path: "/service/MachineConfig",
        name: "通讯接口",
        component: MachineConfig,
        meta: {
          requireAuth: true,
        },
      },
      {
        path: "/service/Config",
        name: "从机设备",
        component: Config,
        meta: {
          requireAuth: true,
        },
      },
    ],
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
